.class public final Les/cc0;
.super Lcom/google/gson/TypeAdapter;
.source "TreeTypeAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Les/cc0$b;,
        Les/cc0$c;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lcom/google/gson/TypeAdapter<",
        "TT;>;"
    }
.end annotation


# instance fields
.field private final a:Lcom/google/gson/JsonSerializer;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/google/gson/JsonSerializer<",
            "TT;>;"
        }
    .end annotation
.end field

.field private final b:Lcom/google/gson/JsonDeserializer;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/google/gson/JsonDeserializer<",
            "TT;>;"
        }
    .end annotation
.end field

.field final c:Lcom/google/gson/Gson;

.field private final d:Les/jc0;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Les/jc0<",
            "TT;>;"
        }
    .end annotation
.end field

.field private final e:Lcom/google/gson/TypeAdapterFactory;

.field private final f:Les/cc0$b;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Les/cc0<",
            "TT;>.b;"
        }
    .end annotation
.end field

.field private g:Lcom/google/gson/TypeAdapter;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/google/gson/TypeAdapter<",
            "TT;>;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Lcom/google/gson/JsonSerializer;Lcom/google/gson/JsonDeserializer;Lcom/google/gson/Gson;Les/jc0;Lcom/google/gson/TypeAdapterFactory;)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/google/gson/JsonSerializer<",
            "TT;>;",
            "Lcom/google/gson/JsonDeserializer<",
            "TT;>;",
            "Lcom/google/gson/Gson;",
            "Les/jc0<",
            "TT;>;",
            "Lcom/google/gson/TypeAdapterFactory;",
            ")V"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Lcom/google/gson/TypeAdapter;-><init>()V

    .line 2
    new-instance v0, Les/cc0$b;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Les/cc0$b;-><init>(Les/cc0;Les/cc0$a;)V

    iput-object v0, p0, Les/cc0;->f:Les/cc0$b;

    .line 3
    iput-object p1, p0, Les/cc0;->a:Lcom/google/gson/JsonSerializer;

    .line 4
    iput-object p2, p0, Les/cc0;->b:Lcom/google/gson/JsonDeserializer;

    .line 5
    iput-object p3, p0, Les/cc0;->c:Lcom/google/gson/Gson;

    .line 6
    iput-object p4, p0, Les/cc0;->d:Les/jc0;

    .line 7
    iput-object p5, p0, Les/cc0;->e:Lcom/google/gson/TypeAdapterFactory;

    return-void
.end method

.method private a()Lcom/google/gson/TypeAdapter;
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Lcom/google/gson/TypeAdapter<",
            "TT;>;"
        }
    .end annotation

    .line 1
    iget-object v0, p0, Les/cc0;->g:Lcom/google/gson/TypeAdapter;

    if-eqz v0, :cond_0

    goto :goto_0

    .line 2
    :cond_0
    iget-object v0, p0, Les/cc0;->c:Lcom/google/gson/Gson;

    iget-object v1, p0, Les/cc0;->e:Lcom/google/gson/TypeAdapterFactory;

    iget-object v2, p0, Les/cc0;->d:Les/jc0;

    invoke-virtual {v0, v1, v2}, Lcom/google/gson/Gson;->getDelegateAdapter(Lcom/google/gson/TypeAdapterFactory;Les/jc0;)Lcom/google/gson/TypeAdapter;

    move-result-object v0

    iput-object v0, p0, Les/cc0;->g:Lcom/google/gson/TypeAdapter;

    :goto_0
    return-object v0
.end method

.method public static a(Les/jc0;Ljava/lang/Object;)Lcom/google/gson/TypeAdapterFactory;
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Les/jc0<",
            "*>;",
            "Ljava/lang/Object;",
            ")",
            "Lcom/google/gson/TypeAdapterFactory;"
        }
    .end annotation

    .line 3
    invoke-virtual {p0}, Les/jc0;->b()Ljava/lang/reflect/Type;

    move-result-object v0

    invoke-virtual {p0}, Les/jc0;->a()Ljava/lang/Class;

    move-result-object v1

    if-ne v0, v1, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    .line 4
    :goto_0
    new-instance v1, Les/cc0$c;

    const/4 v2, 0x0

    invoke-direct {v1, p1, p0, v0, v2}, Les/cc0$c;-><init>(Ljava/lang/Object;Les/jc0;ZLjava/lang/Class;)V

    return-object v1
.end method

.method public static a(Ljava/lang/Class;Ljava/lang/Object;)Lcom/google/gson/TypeAdapterFactory;
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Class<",
            "*>;",
            "Ljava/lang/Object;",
            ")",
            "Lcom/google/gson/TypeAdapterFactory;"
        }
    .end annotation

    .line 5
    new-instance v0, Les/cc0$c;

    const/4 v1, 0x0

    const/4 v2, 0x0

    invoke-direct {v0, p1, v1, v2, p0}, Les/cc0$c;-><init>(Ljava/lang/Object;Les/jc0;ZLjava/lang/Class;)V

    return-object v0
.end method


# virtual methods
.method public read(Lcom/google/gson/stream/a;)Ljava/lang/Object;
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/google/gson/stream/a;",
            ")TT;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Les/cc0;->b:Lcom/google/gson/JsonDeserializer;

    if-nez v0, :cond_0

    .line 2
    invoke-direct {p0}, Les/cc0;->a()Lcom/google/gson/TypeAdapter;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/google/gson/TypeAdapter;->read(Lcom/google/gson/stream/a;)Ljava/lang/Object;

    move-result-object p1

    return-object p1

    .line 3
    :cond_0
    invoke-static {p1}, Lcom/google/gson/internal/i;->a(Lcom/google/gson/stream/a;)Lcom/google/gson/JsonElement;

    move-result-object p1

    .line 4
    invoke-virtual {p1}, Lcom/google/gson/JsonElement;->isJsonNull()Z

    move-result v0

    if-eqz v0, :cond_1

    const/4 p1, 0x0

    return-object p1

    .line 5
    :cond_1
    iget-object v0, p0, Les/cc0;->b:Lcom/google/gson/JsonDeserializer;

    iget-object v1, p0, Les/cc0;->d:Les/jc0;

    invoke-virtual {v1}, Les/jc0;->b()Ljava/lang/reflect/Type;

    move-result-object v1

    iget-object v2, p0, Les/cc0;->f:Les/cc0$b;

    invoke-interface {v0, p1, v1, v2}, Lcom/google/gson/JsonDeserializer;->deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;

    move-result-object p1

    return-object p1
.end method

.method public write(Lcom/google/gson/stream/b;Ljava/lang/Object;)V
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/google/gson/stream/b;",
            "TT;)V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Les/cc0;->a:Lcom/google/gson/JsonSerializer;

    if-nez v0, :cond_0

    .line 2
    invoke-direct {p0}, Les/cc0;->a()Lcom/google/gson/TypeAdapter;

    move-result-object v0

    invoke-virtual {v0, p1, p2}, Lcom/google/gson/TypeAdapter;->write(Lcom/google/gson/stream/b;Ljava/lang/Object;)V

    return-void

    :cond_0
    if-nez p2, :cond_1

    .line 3
    invoke-virtual {p1}, Lcom/google/gson/stream/b;->s()Lcom/google/gson/stream/b;

    return-void

    .line 4
    :cond_1
    iget-object v1, p0, Les/cc0;->d:Les/jc0;

    invoke-virtual {v1}, Les/jc0;->b()Ljava/lang/reflect/Type;

    move-result-object v1

    iget-object v2, p0, Les/cc0;->f:Les/cc0$b;

    invoke-interface {v0, p2, v1, v2}, Lcom/google/gson/JsonSerializer;->serialize(Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;

    move-result-object p2

    .line 5
    invoke-static {p2, p1}, Lcom/google/gson/internal/i;->a(Lcom/google/gson/JsonElement;Lcom/google/gson/stream/b;)V

    return-void
.end method
